From: Brion Vibber Date: Mon, 25 Feb 2008 21:31:59 +0000 (+0000) Subject: Revert r31243, r31244 -- regression: spews bogus protection entries into page history... X-Git-Tag: 1.31.0-rc.0~49349 X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=commitdiff_plain;h=9a9fdc6dcbde967fe28938956f401fa2b87ada87;p=lhc%2Fweb%2Fwiklou.git Revert r31243, r31244 -- regression: spews bogus protection entries into page history when no change is made. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 914c0dfcf1..ff506142be 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -39,7 +39,6 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 10677) Add link to the file description page on the shared repository * (bug 13084) Increase size of source/destination filename fields in upload form * (bug 13115) rebuildrecentchanges should print the current value of $wgRCMaxAge -* (bug 13132) Unable to unprotect pages protected with earlier versions of MediaWiki * (bug 13140) Show parent categories in category namespace * (bug 13149) Correctly format 'fileexists' message on Upload page. * Make filepageexists accurate. diff --git a/includes/Article.php b/includes/Article.php index 68e561ab06..4a18d2b773 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1771,6 +1771,7 @@ class Article { if ( $cascade ) $comment .= "$cascade_description"; + $rowsAffected = false; # Update restrictions table foreach( $limit as $action => $restrictions ) { if ($restrictions != '' ) { @@ -1778,11 +1779,18 @@ class Article { array( 'pr_page' => $id, 'pr_type' => $action , 'pr_level' => $restrictions, 'pr_cascade' => $cascade ? 1 : 0 , 'pr_expiry' => $encodedExpiry ), __METHOD__ ); + if($dbw->affectedRows() != 0) + $rowsAffected = true; } else { $dbw->delete( 'page_restrictions', array( 'pr_page' => $id, 'pr_type' => $action ), __METHOD__ ); + if($dbw->affectedRows() != 0) + $rowsAffected = true; } } + if(!$rowsAffected) + // No change + return true; # Insert a null revision $nullRevision = Revision::newNullRevision( $dbw, $id, $comment, true );